<include file="Public:header" />
<script type="text/javascript" src="__PUBLIC__/js/kindeditor-all-min.js"></script>
<script type="text/javascript" src="__PUBLIC__/js/zh_CN.js"></script>
<link rel="stylesheet" href="__PUBLIC__/css/kindeditor.css" type="text/css" />


<script type="text/javascript">
	<if condition="C('ismobile') neq 1">
		var editor;
	KindEditor.ready(function(K) {
		editor = K.create('textarea[name="content"]', {
			uploadJson:'__APP__/index.php/File/editor/',
			allowFileManager : true,
			loadStyleMode : false,
			fileManagerJson: "__APP__/index.php/File/manager/"
		});
	});
	</if>
</script>


<div class="ibox-content">
<form class="form-horizontal" id="f_add" method="post" >
   <div class="form-group" >
		<label class="col-sm-3 control-label" for="name"></label>
		<div class="col-sm-6"> 
        <h4> 添加职位列表</h4>
		</div>
	</div>

	<div class="form-group" >
		<label class="col-sm-3 control-label" for="name">招聘职位：</label>
		<div class="col-sm-6"> 
          <span class="require">*</span><input  type="text" name="name" id="name" placeholder="招聘职位" size="50"/>
		</div>
	</div>
	
	
	<div class="form-group" >
		<label class="col-sm-3 control-label" for="industry">职位类型：</label>
		<div class="col-sm-6">
			<span class="require">*</span>
			<input  type="text" name="industry" id="industry"  placeholder="职位类型" size="20"/>
		</div>
	</div>
	
	<div class="form-group" >
		<label class="col-sm-3 control-label" for="salary">月薪范围：</label>
		<div class="col-sm-6">
			<span class="require">*</span>
			<select name="salary">
			 <option value="">月薪范围</option>
			 <option value="面议">面议</option>
			 <option value="2000以下">2000以下</option>
			 <option value="2001-3000">2001-3000</option>
			 <option value="3001-4500">3001-4500</option>
			 <option value="4501-8000">4501-8000</option>
			 <option value="8001-10000">8001-10000</option>
			 <option value="10001-20000">10001-20000</option>
			 <option value="20000以上">20000以上</option>
			</select>
		</div>
	</div>

	<!-- div class="form-group" >
		<label class="col-sm-3 control-label" for="company">公司：</label>
		<div class="col-sm-6">
			<span class="require">*</span><input  type="text" name="company" id="company"  placeholder="公司名称" size="50"/>
		</div>
	</div-->

	<div class="form-group" >
		<label class="col-sm-3 control-label" for="num">招聘人数：</label>
		<div class="col-sm-6">
			<span class="require">*</span><input  type="text" name="num" id="num"  placeholder="招聘人数" />
		</div>
	</div>
	
	<div class="form-group" >
		<label class="col-sm-3 control-label" for="zdxl">性别：</label>
		<div class="col-sm-6">
			<span class="require">*</span>
			<select name="sex">
			  <option value="">性别要求</option>
			  <option value="不限">不限</option>
			  <option value="限男性">限男性</option>
			  <option value="限女性">限女性</option>
			</select>
		</div>
	</div>

	
	<div class="form-group" >
		<label class="col-sm-3 control-label" for="zdxl">学历要求：</label>
		<div class="col-sm-6">
			<span class="require">*</span>
			<select name="zdxl">
			  <option value="">最低学历</option>
			  <option value="初中及以下">初中及以下</option>
			  <option value="高中/中技/中专">高中/中技/中专</option>
			  <option value="大专">大专</option>
			  <option value="本科">本科</option>
			  <option value="硕士">硕士</option>
			  <option value="博士">博士</option>
			</select>
			
		</div>
	</div>

	<div class="form-group" >
		<label class="col-sm-3 control-label" for="place">工作地点：</label>
		<div class="col-sm-6">
			<span class="require">*</span><input  type="text" name="place" id="place"  placeholder="地点"/>
		</div>
	</div>

	<!-- div class="form-group" >
		<label class="col-sm-3 control-label" for="gsgm">公司规模：</label>
		<div class="col-sm-6">
			<span class="require">*</span>
			<select name="gsgm">
			<option value="">公司规模</option>
			<option value="少于50人">少于50人</option>
			<option value="50-100人">50-100人</option>
			<option value="150-500人">150-500人</option>
			<option value="500-1000人">500-1000人</option>
			<option value="千人以上">千人以上</option>
			</select>
			
		</div>
	</div-->

	<!-- div class="form-group" >
		<label class="col-sm-3 control-label" for="xzfl">薪资福利：</label>
		<div class="col-sm-6">
			<span class="require">*</span>
			<label><input type="checkbox" name="xzfl[]" value="" /> 五险一金</label> 
			<input  type="text" name="xzfl" id="xzfl"  placeholder="薪资福利"/>
		</div>
	</div-->

	<div class="form-group" >
		<label class="col-sm-3 control-label" for="xinzi">工作性质：</label>
		<div class="col-sm-6">
			<span class="require">*</span>
			<select name="xinzi">
			<option value="">工作性质</option>
			<option value="全职">全职</option>
			<option value="兼职">兼职</option>
			<option value="实习">实习</option>
			</select>
			
		</div>
	</div>

	<div class="form-group" >
		<label class="col-sm-3 control-label" for="gzjy">工作经验：</label>
		<div class="col-sm-6">
			<span class="require">*</span>
			<select name="gzjy">
			<option value="">工作经验</option>
			<option value="无经验">无经验</option>
			<option value="1-3年">1-3年</option>
			<option value="3-5年">3-5年</option>
			<option value="5-10年">5-10年</option>
			<option value="10年以上">10年以上</option>
			</select>
			
		</div>
	</div>
	
	<div class="form-group" >
		<label class="col-sm-3 control-label" for="zdxl">年龄要求：</label>
		<div class="col-sm-6">
			<span class="require">*</span>
			<input  type="text" name="age" id="age"  placeholder="年龄要求"/>
			
		</div>
	</div>

	<div class="form-group" >
		<label class="col-sm-3 control-label" for="gzjy">职位说明：</label>
		<div class="col-sm-6">
			<textarea name="content" id="content" style="width: 800px; height: 350px;"></textarea>
		</div>
	</div>

	<div class="form-group" >
		<label class="col-sm-3 control-label" for="zdxl">招聘类型：</label>
		<div class="col-sm-6">
			<input type="radio" name="class" value="1" checked>  社会招聘
			<input type="radio" name="class" value="2" >  学校招聘
		</div>
	</div>

    <div class="form-group" >
		<label class="col-sm-3 control-label" for="zdxl">发布日期：</label>
		<div class="col-sm-6">
			<span class="require">*</span>
			<input class="date" type="text" name="create_time" id="create_time"  placeholder="发布日期"/>
		</div>
	</div>

    <div class="form-group" >
		<label class="col-sm-3 control-label" for="zdxl">到期日期：</label>
		<div class="col-sm-6">
			<span class="require">*</span>
			<input class="date"  type="text" name="end_time" id="end_time"  placeholder="到期日期"/>
		</div>
	</div>
	

	<div class="form-group">
		<label class="col-sm-3 control-label" for="name"></label>
		<div class="col-sm-8">
			
			<input class="btn btn-primary" id="btn_save" type="submit" name="submit" value="新增"/> &nbsp; 
			<input class="btn" onclick="javascript:layer.closeAll();"  type="button" value="取消"/>
		</div>
	</div>
</form>
</div>


<script type="text/javascript">
	<if condition="C('ismobile') eq 1">
	width=$('.container').width() * 0.9;
	$("#content").css({
		width : width
	});
	</if>
	$("input[name='submit']").click(function(){
//		if($("#content").val() == ""){
//			alert('详情不能为空');
//			return false;
//		}


		$("#content").html(editor.html());
	})

</script>



 <script>


function showResponse(responseText,statusText) {
  if(statusText=='success'){
	  console.log(responseText);
	if (responseText.status == 1) {
		parent.layer.msg(responseText.info, {icon: 1}); //正确的图标提示
		$(".form-control").val("");
		$("#refresh_data_table").trigger("click");
		//parent.layer.closeAll();
	} else {
		parent.layer.msg(responseText.info, {icon: 2}); //错误的图标提示
	}
	
  }
}


$(function(){
	
	$.validator.setDefaults({
		highlight: function (element) {
			$(element).closest('.form-group').removeClass('has-success').addClass('has-error');
		},
		success: function (element) {
			element.closest('.form-group').removeClass('has-error').addClass('has-success');
		},
		errorElement: "span",
		errorPlacement: function (error, element) {
			if (element.is(":radio") || element.is(":checkbox")) {
				error.appendTo(element.parent().parent().parent());
			} else {
				error.appendTo(element.parent());
			}
		},
		errorClass: "help-block m-b-none",
		validClass: "help-block m-b-none"


	});
	
	

   $("#f_add").validate({
        submitHandler:function(form){
			var param = $("#f_add").serialize();  
			var url = '__APP__/index.php/Positions/add/';
			//console.log(url);
			//console.log(param);
	  		ajax_do(url,param);	
			
        }    
    });
   
   $('.date').datepicker({
       autoclose: true,
       format: "yyyy-mm-dd"
   });


	$(".fa-send-o").parent().parent().addClass("active");
	$(".fa-briefcase:first").parent().parent().addClass("active");

});

</script>
<include file="Public:footer" />